package cn.deschen.eshop.user.controller;

import cn.deschen.eshop.common.api.CommonRes;
import cn.deschen.eshop.generator.model.UmsAdmin;
import cn.deschen.eshop.user.dto.req.UmsAdminRegisterReqDto;
import cn.deschen.eshop.user.dto.req.UmsLoginReqDto;
import cn.deschen.eshop.user.service.UmsAdminService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author hanbin_chen
 * @Description 后台用户管理Controller
 * @DateTime 2021/2/22 14:13
 * @Version V1.0.0
 */
@RestController
@Api(tags = "UmsAdminController")
@RequestMapping("/admin")
public class UmsAdminController {

    @Autowired
    private UmsAdminService adminService;

    @ApiOperation(value = "用户注册")
    @PostMapping("/register")
    public CommonRes register(@Validated @RequestBody UmsAdminRegisterReqDto adminRegisterReqDto) {
        adminService.register(adminRegisterReqDto);
        return CommonRes.success();
    }

    // @ApiOperation(value = "用户登录")
    // @PostMapping("/login")
    // public CommonRes login(@Validated @RequestBody UmsLoginReqDto loginResDto) {
    //     adminService.
    // }

}
